import {
	baseUrl, //引入baseUrl
} from "../config/env.js"
import axios from 'axios'
axios.defaults.headers.post['Content-Type'] = 'application/json'
axios.defaults.timeout = 10000//设置请求时间
// axios.defaults.changeOrigin = true
// axios.defaults.target = '*'
axios.defaults.baseURL = baseUrl//设置默认接口地址
export function post(url, data) {
	return new Promise((resolve, reject) => {
		axios.post(url, data, { 'withCredentials': true })
			.then(res => {
				resolve(res.data)
			})	
			.catch(err => {
				reject(err)
			})
	})
}
